﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;

namespace WindowsServiceTscPrint
{
    public partial class Service1 : ServiceBase
    {
        public Service1()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            try
            {
                // 接收RocketMQ打印消息
                RocketHelpter.ReviceMsg();
            }
            catch (Exception ex)
            {
                LogHelpter.AddLog("启动接收RocketMq消息异常，"+ex.ToString());
            }
        }

        protected override void OnStop()
        {
            //停止接收消息
            RocketHelpter.StopConsumer();
        }
    }
}
